import {
  post,
  get,
  put,
  dalete,
  postJosn,
  putone,
  patch,
  daleteJson,
  download
} from '../utils/request';

//头部看板统计信息查询
export function queryTradeOrderTotal(data) {
  //return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderTotal', data);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderTotal', data);
  return post('/api/data-service/v1/dataTradeSearch/queryTradeOrderTotal', data);
}

export function queryTradeOrderTotalone(data) {
  return post('/api/user-service/storeActivation/queryActivationCount?beginDate=' + data.beginDate + '&endDate=' + data.endDate);
}

//分页查询订单列表
export function queryTradeOrderByParam(data) {
  //return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderByParam', data);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderByParam', data);
  return post('/api/data-service/v1/dataTradeSearch/queryTradeOrderByParam', data);
}

//分页查询订单列表
export function queryTradeOrderByParamone(data) {
  return post('/api/data-service/StoreActivation/queryStoreActivation', data);
}

//下载
export function excelTradeOrderByParamone(data) {
  return download('/api/data-service/StoreActivation/exportStoreActivation', data);
}

//不分页查询订单列表
export function queryTradeOrderByParamNoPage(data) {
  //return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderByParamNoPage', data);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderByParamNoPage', data);
  return post('/api/data-service/v1/dataTradeSearch/queryTradeOrderByParamNoPage', data);
}

//导表
export function excelTradeOrderByParam(data) {
  //return download('/api/trade-service/v1/tradeOrderSearch/excelTradeOrderByParam',data);
  //return download('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/excelTradeOrderByParam', data);
  return download('/api/data-service/v1/dataTradeSearch/excelTradeOrderByParam', data);
}


//查询订单支付信息
export function queryTradeOrderPayInfo(data) {
  return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderPayInfo?orderId=' + data.orderId);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderPayInfo?orderId='+data.orderId);
  //return post('/api/data-service/v1/dataTradeSearch/queryTradeOrderPayInfo?orderId='+data.orderId);
}

//查询订单商品列表
export function queryTradeOrderItemList(data) {
  return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderItemList?orderId=' + data.orderId);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderItemList?orderId='+data.orderId);
  //return post('/api/data-service/v1/dataTradeSearch/queryTradeOrderItemList?orderId='+data.orderId);
}

//查询订单商品列表（降解到最小商品单位的商品分类列表）
export function queryTradeOrderMinItemList(data) {
  return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderMinItemList?orderId=' + data.orderId);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderMinItemList?orderId='+data.orderId);
  //return post('/api/data-service/v1/dataTradeSearch/queryTradeOrderMinItemList?orderId='+data.orderId);
}

//查询订单物流列表
export function queryTradeOrderDeliverList(data) {
  return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderDeliverList?orderId=' + data.orderId);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderDeliverList?orderId='+data.orderId);
}

//查询订单赠品列表
export function queryTradeOrderGiftList(data) {
  return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderGiftList?orderId=' + data.orderId);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderGiftList?orderId='+data.orderId);
}

//查询订单宴席列表
export function queryTradeOrderFeastList(data) {
  return post('/api/trade-service/v1/tradeOrderSearch/queryTradeOrderFeastList?orderId=' + data.orderId);
  //return post('http://127.0.0.1:18080/api/trade-service/v1/tradeOrderSearch/queryTradeOrderFeastList?orderId='+data.orderId);
}

//查询主表表头字段
export function queryUserMenuFieldByParam(data) {
  return post('/api/user-service/v1/userMenuField/queryUserMenuFieldByParam', data);
  //return post('http://127.0.0.1:18080/api/user-service/v1/userMenuField/queryUserMenuFieldByParam', data);
}

//保存主表表头字段
export function insertUserFieldRelation(data) {
  return post('/api/user-service/v1/userMenuField/insertUserFieldRelation', data);
  //return post('http://127.0.0.1:18080/api/user-service/v1/userMenuField/insertUserFieldRelation', data);
}


//分页查询专卖店扫码出库数据统计列表
export function queryScanCodeByParam(data) {
  //return post('http://127.0.0.1:18080/api/trade-service/v1/myorder/queryScanCodeByParam', data);
  return post('/api/trade-service/v1/myorder/queryScanCodeByParam', data);
}
//根据扫码出库的uuid 查询条码  get请求 入参 uuid
export function queryBarCodeById(data) {
  //return post('http://127.0.0.1:18080/api/trade-service/v1/myorder/queryBarCodeById', data);
  return get('/api/trade-service/v1/myorder/queryBarCodeById?' + data);
}
export function queryScanGoods(data) {
  //return post('http://127.0.0.1:18080/api/trade-service/v1/myorder/queryScanGoods', data);
  return post("/api/trade-service/v1/myorder/queryScanGoods", data);
}
export function queryScanCodeTotal(data) {
  //return post('http://127.0.0.1:18080/api/trade-service/v1/myorder/queryScanCodeTotal', data);
  return post("/api/trade-service/v1/myorder/queryScanCodeTotal", data);
}
//导出
export function queryScanCodeListExcel(data) {
  //return download('http://127.0.0.1:18080/api/trade-service/v1/myorder/queryScanCodeListExcel', data);
  return download('/api/trade-service/v1/myorder/queryScanCodeListExcel', data);
}

export function onlinePayQuery(data) {
  return post("/api/pay-service/v1/pay/onlinePayQuery", data);
}

// 查询物流信息
export function queryLogisticsInfo(data) {
  return post("/api/trade-service/v1/myorder/queryexpIndex", data);
}

// 改变订单状态
export function upOrderStatusByOrderId(params) {
  return get("/api/trade-service/v1/myorder/upOrderStatusByOrderId", params);
}

// 取货码
export function queryTdcode(data) {
  return post(`/api/trade-service/v1/myorder/queryTdcode?orderId=${data.orderId}`);
}